﻿using System.Web.Http;
using System.Web.Mvc;

namespace CNKI.TPI.Web.Interface.Areas.Log
{
    public class LogAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Log";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            GlobalConfiguration.Configuration.Routes.MapHttpRoute(
                             name: "Log_default",
                             routeTemplate: "api/Log/{controller}/{action}/{id}",
                             defaults: new
                             {
                                 action = RouteParameter.Optional,
                                 id = RouteParameter.Optional,
                                 namespaceName = new string[] { string.Format("CNKI.TPI.Web.Interface.Areas.{0}.Controllers", this.AreaName) }
                             }
                         );
        }
    }
}
